(1) Field of the Invention
This invention relates to an information processing method and a recording medium, and more particularly to an information processing method and a recording medium which are capable of causing a computing device having a plurality of processors to carry out predetermined information processing.
(2) Description of the Related Art
When a computing device having a plurality of processors is caused to execute a program, there has been generally employed a method of dividing the program into a plurality of parallel processing blocks, and dividing each of the obtained parallel processing blocks into threads which are basic units for processing, and assigning the threads to the processors.
FIG. 10 is a diagram showing a case in which a program on a left-hand side as viewed in the figure is executed by the above method by using a computing device having five processors. In this example, the program to be executed includes two loops to be executed (line numbers “1” to “3” and line numbers “5” to “7”) which are set to a first parallel processing block and a second parallel processing block, respectively.
When the above program is executed, threads #1 to #5 are generated as basic units to be processed by the respective processors. The thread #1 takes its share of a first loop (loop with line numbers “1” to “3”) with a variable i within a range of “1” to “200”. The thread #2 takes its share of the same first loop with the variable i within a range of “201” to “400”. Similarly, the threads #3, #4, and #5 take their shares of the first loop with the variable i within ranges of “401” to “600”, “601” to “800”, and “801” to “1000”, respectively.
In the conventional method, however, a monitoring mechanism called “barrier” is arranged between the parallel processing blocks to thereby hold a next parallel processing block from being executed until processing of all the threads is completed.
As a result, when a plurality of parallel processing blocks are to be processed, a time period required for processing all the blocks becomes equal to a sum of the longest time periods each of which is taken to process the most time-consuming one of the threads of each parallel processing block. As a result, it is sometimes impossible to make effective use of the processor resources.